import xlrd
import xlwt

baidu = xlrd.open_workbook(filename="百度合作单位-人员管理-二期.xls", encoding_override=True)
sheet = baidu.sheet_by_index(0)
col = sheet.ncols  # 获取列
row = sheet.nrows  # 获取行


def all_name():
    for i in range(row):
        print(sheet.row_values(i))

# name = 0
# name1 = 0
# name2 = 0
# for i in range(1, row):
#     num = sheet.col_values(5)[i][0:2]
#     num = int(num)
#     print(str(num))
#     if num == 14 or num == 17:
#         name = name + 1
#     elif num == 13:
#         name1 = name1 + 1
#     elif num == 15:
#         name2 = name2 + 1
# print("使用电信的人数:", name)
# print("使用移动的人数:", name1)
# print("使用联通的人数:", name2)

# gender = 0
# gender1 = 0
# for i in range(1, row):
#     num = sheet.col_values(8)[i]
#     if num == "男":
#         gender = gender + 1
#     elif num == "女":
#         gender1 = gender1 + 1
# print("男的人数:", gender)
# print("女的人数:", gender1)
# age = 0
# for i in range(1, row):
#     num = sheet.col_values(7)[i]
#     num = int(num)
#     if num > 45:
#         age = age + 1
# print("老员工的人数:", age)
# money = 0
# money1 = 0
# for i in range(1, row):
#     num = sheet.col_values(11)[i]
#     num = int(num)
#     if num > 8000:
#         money = money + 1
#     elif num < 3000:
#         money1 = money1 + 1
# print("薪资高于八千:", money)
# print("薪资低于三千", money1)
# num1 = 0
# for i in range(1, 300):
#     num = sheet.col_values(13)[i][-6:-4]
#     if num == "传媒":
#         num1 = num1 + 1
# print("传媒公司的人数:", num1)
# heilongjiang = 0
# beijing = 0
# fujian = 0
# sichuan = 0
# for i in range(1, row):
#     site = sheet.col_values(9)[i][0:2]
#     site1 = sheet.col_values(9)[i][0:3]
#     if site == "北京":
#         beijing = beijing + 1
#     elif site == "四川":
#         sichuan = sichuan + 1
#     elif site == "福建":
#         fujian = fujian + 1
#     elif site1 == "黑龙江":
#         heilongjiang = heilongjiang + 1
# print("高风险地区")
# print("北京:", beijing)
# print("四川:", sichuan)
# print("福建:", fujian)
# print("黑龙江:", heilongjiang)
